<script>

class Father{
    constructor(name){
        this.name = name
    }
    getName(){
        console.log(this.name)
    }
}

class Son extends Father{
    constructor(name,age){
        super(name)
        this.age = age
    }
    //自动继承方法
}

let son = new Son('gailun',10)
son.getName()

</script>